package apiday04;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;

public class ListDemo01 {
    public static void main(String[] args) {
        List<String> list = new ArrayList<>();
        list.add("one");
        list.add("two");
        list.add("three");
        list.add("four");
        list.add("five");

        for (int i = 0; i < list.size()/2; i++) {
            String s = list.get(list.size()-1-i);
            String s1 = list.get(i);
            list.set(i,s);
            list.set(list.size()-1-i,s1);
        }
        System.out.println(list);
        Collections.reverse(list);
        System.out.println(list);

    }

}
